/* ----------------------------------------------------------------------
*
* Copyright (C) 2025 XiaoFei. All rights reserved.
*
* $file:		XiaoFei_Usart2.h
* $Date:        13-January-2025
* $Revision: 	V1
* $Project: 	XiaoFei BSP Library
*
* -------------------------------------------------------------------- */

#ifndef __XiaoFei_Usart2_H
#define __XiaoFei_Usart2_H

#define Usart2_AddRx
#define Usart2_GPIO					    GPIOA
#define Usart2_Pin_TX				    GPIO_Pin_2
#define Usart2_BaudRate			        9600

#ifdef Usart2_AddRx
	#define Usart2_Pin_RX				GPIO_Pin_3
	#define USART2_Group				NVIC_PriorityGroup_2
	#define USART2_ITPre				1
	#define USART2_ITSub				1
#endif

/* 
* @function: 	Usart2_Init
*/
void Usart2_Init(void);

/* 
* @function: 	Usart2_SendByte
* @parameter:	[in] Byte					 The byte will be send.
*/
void Usart2_SendByte(unsigned char Byte);

/* 
* @function: 	Usart2_Printf
* @parameter:	[in] format					 The parameter will be send in Usart2_Printf.
*/
void Usart2_Printf(char *format, ...);

#ifdef Usart2_AddRx
/* 
* @function: 	USART2_IRQHandler
* @callback:	The function will be callback when the Usart2 receive the data.
*/
void USART2_IRQHandler(void);
#endif

#endif
